package com.controller;


import com.entity.User;
import com.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;


public class UserController {
    private final UserService userService;

    @Autowired
    public UserController(UserService userService) {
        this.userService = userService;
    }

    public void save(User user) {
//        System.out.print("id:" + user.getId());
//        System.out.print("name:" + user.getName());
//        System.out.println("password:" + user.getPassword());
        System.out.println(user.toString());
        System.out.println("在Controller层执行UserController的save方法");
        userService.save(user);
    }
}